package org.ccay.hypertext.enumerable;

import org.ccay.enumerable.EnumI18nUtil;
import org.ccay.enumerable.EnumItem;
import org.ccay.enumerable.EnumUtil;
import org.ccay.enumerable.SourceEnum;

/**
 * 富文本资源类型定义
 * @author chaowangbang
 *
 */
public enum HyperCategoryEnum implements EnumItem<HyperCategoryEnum>{
	StaticResource("0","静态资源"),
	MailTemplate("1","邮件模板");
	private String value;
	private String displayValue;

	private HyperCategoryEnum(String value, String displayValue){
		this.value = value;
		this.displayValue = displayValue;
	}
	
	@Override
	public String getType() {
		return this.getClass().getSimpleName();
	}

	@Override
	public int getIndex() {
		return ordinal();
	}

	@Override
	public String getName() {
		return this.name();
	}

	@Override
	public String getValue() {
		return value;
	}

	@Override
	public String getDisplayValue() {
		return displayValue;
	}

	@Override
	public String getSource() {
		return SourceEnum.SOURCE_JAVA.getValue();
	}

	@Override
	public String getDisplayValue(String language) {
		return EnumI18nUtil.getI18nName(this, language);
	}

	@Override
	public EnumItem<HyperCategoryEnum> fromValue(String value) {
		return  EnumUtil.getInstance().getByTypeValue(getType(),  getValue());
	}
}